<template>
    <div class="rx-news-center" >
        <div class="rx-news-top">
            <div class="rx-news-isRead">
                <i class="iconfont icon-Vue3_notice-filled"></i>
            </div>
            <div class="rx-news-name">
                <div>{{ messageObj.msgTitle }}</div>
                <div class="rx-news-html" v-html="messageObj.content"></div>
            </div>
        </div>
        <div class="rx-news-bottom">
            <span class="rx-news-createTime">{{ messageObj.createTime }}</span>
            <span class="rx-news-sender">{{ messageObj.sender }}</span>
        </div>
    </div>

</template>

<script type="text/ecmascript-6">
import GatewayApi from "@/api/Gateway/GatewayApi";

export default {
    name: 'RxNewsdetails',
    data() {
        return {
            messageObj: {}
        }
    },
    onLoad(option) {
        this.messageObj = JSON.parse(decodeURIComponent(option.params));
        this.init()
    },
    methods: {
        init() {
            let params = {
                msgId: this.messageObj.pkId
            }
            GatewayApi.readMessage(params)
        }
    }
}
</script>

<style scoped>
.rx-news-center{
    display: flex;
    flex-direction: column;
    background-color: #FFFFFF;
    overflow: hidden;
    box-shadow: 0rem 0rem 0rem 0rem rgba(50, 71, 119, 0.06);
    border-radius: 10px;
    padding: 0.5rem;
    margin: 0.5rem;
}
.rx-news-top{
    display: flex;
    align-items: baseline;
    border-bottom: 1px solid rgba(232, 232, 232, 1);
    padding-bottom: 0.5rem;
}
.rx-news-isRead{
    margin-right: 0.5rem;
    width: 1.5rem;
    height: 1.5rem;
    background-image: linear-gradient(-42deg,
    #7461ff 0%,
    #6ba1ff 100%),
    linear-gradient(#ffc037,
        #ffc037);
    background-blend-mode: normal,
    normal;
    border-radius: 50%;
    text-align: center;
    line-height: 2rem;
    position: relative;
    float: left;
    margin-top: 0.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.rx-news-isRead i {
    font-size: 17px;
    color: #FFFFFF;
}
.rx-news-isRead span {
    width: 4px;
    height: 4px;
    background-color: red;
    border-radius: 50%;
    position: absolute;
    display: block;
    right: 5px;
    top: 5px;
}
.rx-news-name{
    flex: 1;
}
.rx-news-bottom{
    display: flex;
    padding-top: 0.5rem;
}
.rx-news-createTime{
    flex: 1;
    color: rgba(0, 0, 0, 0.45);
    font-size: 0.8rem;
}
.rx-news-sender{
    font-size: 0.8rem;
    color: rgba(66, 133, 244, 1);
}
.rx-news-html{
    font-size: 0.8rem;
    margin-top: 0.5rem;
}
</style>
